<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>mpi.core</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css"></link>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">

<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="center">
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="http://www.penzilla.net/mmpi/docs/top.shtml">Home</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar" align="right" width="100%">
      <table border="0" cellpadding="0" cellspacing="0">
      <tr><th class="navbar" align="center">
        <p class="nomargin">
          <a class="navbar" target="_top" href="http://www.penzilla.net/mmpi/">Project&nbsp;Homepage</a>
      </p></th></tr></table>
    </th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <font size="-1"><b class="breadcrumbs">
        <a href="mpi-module.html">Package&nbsp;mpi</a> ::
        Module&nbsp;core
      </b></font></br>
    </td>
    <td><table cellpadding="0" cellspacing="0">
      <tr><td align="right"><font size="-2">[<a href="../private/mpi.core-module.html">show&nbsp;private</a>&nbsp;|&nbsp;hide&nbsp;private]</font></td></tr>
      <tr><td align="right"><font size="-2">[<a href="frames.html"target="_top">frames</a>&nbsp;|&nbsp;<a href="mpi.core-module.html" target="_top">no&nbsp;frames</a>]</font></td></tr>
    </table></td>
</tr></table>

<!-- =========== START OF MODULE DESCRIPTION =========== -->
<h2 class="module">Module mpi.core</h2>

<p>MMPI - MPI Interface for Python Copyright (C) 2005 Michael 
Steder(steder&#64;gmail.com)</p>
<p>This library is free software; you can redistribute it and/or modify 
it under the terms of the GNU General Public License as published by the 
Free Software Foundation; either version 2 of the License, or (at your 
option) any later version.</p>
<p>This library is distributed in the hope that it will be useful, but 
WITHOUT ANY WARRANTY; without even the implied warranty of 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 
Public License for more details.</p>
You should have received a copy of the GNU General Public License 
along with this program; if not, write to the Free Software Foundation, 
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<hr/>

<!-- =========== START OF FUNCTION SUMMARY =========== -->
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="summary">
  <th colspan="2">Function Summary</th></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#abort" class="summary-sig-name"><code>abort</code></a>(<span class=summary-sig-arg>comm</span>,
          <span class=summary-sig-arg>errorcode</span>)</span></code>
<br />
errorcode = abort(comm [, errorcode ] )

i.e.:
ier = send( ...</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#allreduce" class="summary-sig-name"><code>allreduce</code></a>(<span class=summary-sig-arg>send_buff</span>,
          <span class=summary-sig-arg>count</span>,
          <span class=summary-sig-arg>datatype</span>,
          <span class=summary-sig-arg>op</span>,
          <span class=summary-sig-arg>comm</span>)</span></code>
<br />
result = allreduce( send_buff, count, datatype, op, comm )

Example:
  sum = allreduce( partial_result, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD )

'sum' on all processors of MPI_COMM_WORLD will contain the sum
of all the 'partial_results' of all the processors in MPI_COMM_WORLD.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><a name="alltoall"></a><span class="summary-sig"><span class="summary-sig-name">alltoall</span>(<span class="summary-sig-kwarg">**args</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><a name="alltoallv"></a><span class="summary-sig"><span class="summary-sig-name">alltoallv</span>(<span class="summary-sig-kwarg">**args</span>)</span></code>
</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#barrier" class="summary-sig-name"><code>barrier</code></a>(<span class=summary-sig-arg>comm</span>)</span></code>
<br />
error_code = barrier( mycomm )</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#bcast" class="summary-sig-name"><code>bcast</code></a>(<span class=summary-sig-arg>input</span>,
          <span class=summary-sig-arg>count</span>,
          <span class=summary-sig-arg>datatype</span>,
          <span class=summary-sig-arg>source</span>,
          <span class=summary-sig-arg>comm</span>)</span></code>
<br />
answer = bcast( 42, 1, MPI_INT, 0, MPI_COMM_WORLD )</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#comm_create" class="summary-sig-name"><code>comm_create</code></a>(<span class=summary-sig-arg>comm</span>,
          <span class=summary-sig-arg>group</span>)</span></code>
<br />
newcomm = comm_create( comm, group )</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#comm_dup" class="summary-sig-name"><code>comm_dup</code></a>(<span class=summary-sig-arg>comm</span>)</span></code>
<br />
copy_of_comm = comm_dup( comm )</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#comm_group" class="summary-sig-name"><code>comm_group</code></a>(<span class=summary-sig-arg>comm</span>)</span></code>
<br />
group = comm_group( comm )</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#comm_rank" class="summary-sig-name"><code>comm_rank</code></a>(<span class=summary-sig-arg>comm</span>)</span></code>
<br />
my_rank_in_comm = mpi.comm_rank( comm )</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#comm_size" class="summary-sig-name"><code>comm_size</code></a>(<span class=summary-sig-arg>comm</span>)</span></code>
<br />
size_of_comm = mpi.comm_size( comm )</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#comm_split" class="summary-sig-name"><code>comm_split</code></a>(<span class=summary-sig-arg>incomm</span>,
          <span class=summary-sig-arg>color</span>,
          <span class=summary-sig-arg>key</span>)</span></code>
<br />
Creates a new communicator from all the processors in the
communicator 'incomm'.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#error" class="summary-sig-name"><code>error</code></a>()</span></code>
<br />
ierr = error()</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#error_string" class="summary-sig-name"><code>error_string</code></a>()</span></code>
<br />
s = error_code()</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#finalize" class="summary-sig-name"><code>finalize</code></a>()</span></code>
<br />
mpi.finalize() # shutdown MPI</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#gather" class="summary-sig-name"><code>gather</code></a>(<span class=summary-sig-arg>sendbuffer</span>,
          <span class=summary-sig-arg>sendcount</span>,
          <span class=summary-sig-arg>sendtype</span>,
          <span class=summary-sig-arg>recvcount</span>,
          <span class=summary-sig-arg>recvtype</span>,
          <span class=summary-sig-arg>root</span>,
          <span class=summary-sig-arg>comm</span>)</span></code>
<br />
receive_buffer = gather( sendbuffer, sendcount, sendtype,...</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#gatherv" class="summary-sig-name"><code>gatherv</code></a>(<span class=summary-sig-arg>sendbuffer</span>,
          <span class=summary-sig-arg>sendcount</span>,
          <span class=summary-sig-arg>sendtype</span>,
          <span class=summary-sig-arg>recvcount</span>,
          <span class=summary-sig-arg>displacements</span>,
          <span class=summary-sig-arg>recvtype</span>,
          <span class=summary-sig-arg>root</span>,
          <span class=summary-sig-arg>comm</span>)</span></code>
<br />
receive_buffer = gather( sendbuffer, sendcount, sendtype,
                         recvcount, displacements, recvtype,
                         root, comm)

Gatherv is a special case of gather that allows you to specify
how the data is distributed by passing a displacements array.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#get_count" class="summary-sig-name"><code>get_count</code></a>(<span class=summary-sig-arg>datatype</span>)</span></code>
<br />
count = get_count( datatype )</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#group_incl" class="summary-sig-name"><code>group_incl</code></a>(<span class=summary-sig-arg>group</span>,
          <span class=summary-sig-arg>n</span>,
          <span class=summary-sig-arg>ranks</span>)</span></code>
<br />
group_out = group_incl( group, n, ranks )</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#group_rank" class="summary-sig-name"><code>group_rank</code></a>(<span class=summary-sig-arg>group</span>)</span></code>
<br />
rank = group_rank( group, rank )</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#init" class="summary-sig-name"><code>init</code></a>(<span class=summary-sig-arg>argc</span>,
          <span class=summary-sig-arg>argv</span>)</span></code>
<br />
myrank, numprocs = mpi.init( Integer argc, List[String] argv )...</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#initialized" class="summary-sig-name"><code>initialized</code></a>()</span></code>
<br />
init_status = mpi.initialized()

Returns 0 if MPI_Init has not been called.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#iprobe" class="summary-sig-name"><code>iprobe</code></a>(<span class=summary-sig-arg>source</span>,
          <span class=summary-sig-arg>tag</span>,
          <span class=summary-sig-arg>comm</span>)</span></code>
<br />
result = iprobe( source, tag, comm )</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#irecv" class="summary-sig-name"><code>irecv</code></a>(<span class=summary-sig-arg>count</span>,
          <span class=summary-sig-arg>datatype</span>,
          <span class=summary-sig-arg>source</span>,
          <span class=summary-sig-arg>tag</span>,
          <span class=summary-sig-arg>comm</span>)</span></code>
<br />
request_id, buffer = irecv( count, datatype, source, tag, communicator )

irecv and recv have the same argument list but differ in return values.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#isend" class="summary-sig-name"><code>isend</code></a>(<span class=summary-sig-arg>buffer</span>,
          <span class=summary-sig-arg>count</span>,
          <span class=summary-sig-arg>datatype</span>,
          <span class=summary-sig-arg>destination</span>,
          <span class=summary-sig-arg>tag</span>,
          <span class=summary-sig-arg>comm</span>)</span></code>
<br />
request = isend(buffer, count, datatype, destination, tag, communicator)

Send 'buffer', which consists of 'count' elements of type 'datatype',
to the processor in 'comm' that has rank 'destination' and is waiting
for a message with tag == 'tag'.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#probe" class="summary-sig-name"><code>probe</code></a>(<span class=summary-sig-arg>source</span>,
          <span class=summary-sig-arg>tag</span>,
          <span class=summary-sig-arg>comm</span>)</span></code>
<br />
result = probe( source, tag, comm )</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#recv" class="summary-sig-name"><code>recv</code></a>(<span class=summary-sig-arg>count</span>,
          <span class=summary-sig-arg>datatype</span>,
          <span class=summary-sig-arg>source</span>,
          <span class=summary-sig-arg>tag</span>,
          <span class=summary-sig-arg>comm</span>)</span></code>
<br />
buffer = recv( count, datatype, source, tag, comm )

receive 'buffer', which consists of 'count' elements of type 'datatype',
from the processor in 'comm' that has rank 'source' and is waiting
for a message with tag == 'tag'.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#reduce" class="summary-sig-name"><code>reduce</code></a>(<span class=summary-sig-arg>send_buff</span>,
          <span class=summary-sig-arg>count</span>,
          <span class=summary-sig-arg>datatype</span>,
          <span class=summary-sig-arg>op</span>,
          <span class=summary-sig-arg>root</span>,
          <span class=summary-sig-arg>comm</span>)</span></code>
<br />
result = reduce( send_buff, count, datatype, op, root, comm )

Example:

  if ( rank = 0 ):
    sum = reduce( partial_result, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD )
  else:
    reduce( partial_result, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD )

'sum' on processor 0 of MPI_COMM_WORLD will contain the sum
of all the 'partial_results' of all the processors in MPI_COMM_WORLD.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#scatter" class="summary-sig-name"><code>scatter</code></a>(<span class=summary-sig-arg>sendbuffer</span>,
          <span class=summary-sig-arg>send_count</span>,
          <span class=summary-sig-arg>send_type</span>,
          <span class=summary-sig-arg>receive_count</span>,
          <span class=summary-sig-arg>receive_type</span>,
          <span class=summary-sig-arg>root</span>,
          <span class=summary-sig-arg>comm</span>)</span></code>
<br />
receive_buffer = scatter( sendbuffer, send_count, send_type,...</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#scatterv" class="summary-sig-name"><code>scatterv</code></a>(<span class=summary-sig-arg>sendbuffer</span>,
          <span class=summary-sig-arg>send_count</span>,
          <span class=summary-sig-arg>displacements</span>,
          <span class=summary-sig-arg>send_type</span>,
          <span class=summary-sig-arg>receive_count</span>,
          <span class=summary-sig-arg>receive_type</span>,
          <span class=summary-sig-arg>root</span>,
          <span class=summary-sig-arg>comm</span>)</span></code>
<br />
receive_buffer = scatterv( sendbuffer, send_count, displacements,
                   send_type, receive_count, receive_type,
                   root, comm )

Scatterv is a special case of Scatter that allows you to
specify displacements.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#send" class="summary-sig-name"><code>send</code></a>(<span class=summary-sig-arg>buffer</span>,
          <span class=summary-sig-arg>count</span>,
          <span class=summary-sig-arg>datatype</span>,
          <span class=summary-sig-arg>destination</span>,
          <span class=summary-sig-arg>tag</span>,
          <span class=summary-sig-arg>comm</span>)</span></code>
<br />
error_code = send( buffer, count, datatype, destination, tag, comm )

Send 'buffer', which consists of 'count' elements of type 'datatype',
to the processor in 'comm' that has rank 'destination' and is waiting
for a message with tag == 'tag'.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#status" class="summary-sig-name"><code>status</code></a>()</span></code>
<br />
( source, tag, error ) = status()</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#test" class="summary-sig-name"><code>test</code></a>(<span class=summary-sig-arg>request</span>)</span></code>
<br />
ready = test( request_id )

if ( test( request_id )):
    print 'Non-blocking send or receive operation is complete!'

Note that the request ID is no longer valid after this call
returns successfully and the operation is complete.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#wait" class="summary-sig-name"><code>wait</code></a>(<span class=summary-sig-arg>request</span>)</span></code>
<br />
request_id = wait( request_id )</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#wtick" class="summary-sig-name"><code>wtick</code></a>()</span></code>
<br />
resolution = wtick()</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
  <td><code><span class="summary-sig"><a href="mpi.core-module.html#wtime" class="summary-sig-name"><code>wtime</code></a>()</span></code>
<br />
time = wtime()</td></tr>
</table><br />


<!-- =========== START OF FUNCTION DETAILS =========== -->
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="details">
  <th colspan="2">Function Details</th></tr>
</table>

<a name="abort"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">abort</span>(<span class=sig-arg>comm</span>,
          <span class=sig-arg>errorcode</span>=<span class=sig-default>None</span>)</span>
  </h3>
<pre class="literalblock">
errorcode = abort(comm [, errorcode ] )

i.e.:
ier = send( ... )
if ( ier ):
   abort( MPI_COMM_WORLD, ier )
   #OR
   abort( MPI_COMM_WORLD )

Terminates the MPI Execution environment
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="allreduce"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">allreduce</span>(<span class=sig-arg>send_buff</span>,
          <span class=sig-arg>count</span>,
          <span class=sig-arg>datatype</span>,
          <span class=sig-arg>op</span>,
          <span class=sig-arg>comm</span>)</span>
  </h3>
<pre class="literalblock">
result = allreduce( send_buff, count, datatype, op, comm )

Example:
  sum = allreduce( partial_result, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD )

'sum' on all processors of MPI_COMM_WORLD will contain the sum
of all the 'partial_results' of all the processors in MPI_COMM_WORLD.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="barrier"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">barrier</span>(<span class=sig-arg>comm</span>)</span>
  </h3>
  <p>error_code = barrier( mycomm )</p>
  <p>Causes all processors in 'mycomm' to synchronize at the call to 
  'barrier' before proceeding.</p>
  Barrier is normally used to ensure synchronization between 
  processors.
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="bcast"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">bcast</span>(<span class=sig-arg>input</span>,
          <span class=sig-arg>count</span>,
          <span class=sig-arg>datatype</span>,
          <span class=sig-arg>source</span>,
          <span class=sig-arg>comm</span>)</span>
  </h3>
  <p>answer = bcast( 42, 1, MPI_INT, 0, MPI_COMM_WORLD )</p>
  This sends 'count' numbers (in this case just 42) from 'source' to 
  every other processor in 'comm'.
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="comm_create"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">comm_create</span>(<span class=sig-arg>comm</span>,
          <span class=sig-arg>group</span>)</span>
  </h3>
  <p>newcomm = comm_create( comm, group )</p>
  Creates a new communicator from a current communicator and processor 
  group.
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="comm_dup"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">comm_dup</span>(<span class=sig-arg>comm</span>)</span>
  </h3>
  copy_of_comm = comm_dup( comm )
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="comm_group"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">comm_group</span>(<span class=sig-arg>comm</span>)</span>
  </h3>
  group = comm_group( comm )
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="comm_rank"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">comm_rank</span>(<span class=sig-arg>comm</span>)</span>
  </h3>
  <p>my_rank_in_comm = mpi.comm_rank( comm )</p>
  Returns the rank of this MPI Processor in the communicator 
  'comm'.
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="comm_size"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">comm_size</span>(<span class=sig-arg>comm</span>)</span>
  </h3>
  <p>size_of_comm = mpi.comm_size( comm )</p>
  Returns the number of MPI Processors in the communicator 'comm'.
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="comm_split"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">comm_split</span>(<span class=sig-arg>incomm</span>,
          <span class=sig-arg>color</span>,
          <span class=sig-arg>key</span>=<span class=sig-default>0</span>)</span>
  </h3>
<pre class="literalblock">
Creates a new communicator from all the processors in the
communicator 'incomm'.

All processors that call 'comm_split' with the same 'color' value
(an integer &gt;= 0) will be placed in the same communicator.

'key' determines how the new communicators are sorted.  Unless
you know you need to change this value the default should be fine.

Example:
  evenodd_comm = comm_split( MPI_COMM_WORLD, myrank % 2 )

This divides all your processors into 'even' and 'odd' processors
depending on their rank and places them into seperate
'even' and 'odd' communicators.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="error"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">error</span>()</span>
  </h3>
  <p>ierr = error()</p>
  Returns most recent MPI calls return value/error code.
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="error_string"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">error_string</span>()</span>
  </h3>
  <p>s = error_code()</p>
  Returns the description that corresponds to the current error / 
  status code.
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="finalize"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">finalize</span>()</span>
  </h3>
  <p>mpi.finalize() # shutdown MPI</p>
  You should either call this function when you are done making MPI 
  calls or before your program exits.
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="gather"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">gather</span>(<span class=sig-arg>sendbuffer</span>,
          <span class=sig-arg>sendcount</span>,
          <span class=sig-arg>sendtype</span>,
          <span class=sig-arg>recvcount</span>,
          <span class=sig-arg>recvtype</span>,
          <span class=sig-arg>root</span>,
          <span class=sig-arg>comm</span>)</span>
  </h3>
<pre class="literalblock">
receive_buffer = gather( sendbuffer, sendcount, sendtype,
                         recvcount,  recvtype, root, comm)
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="gatherv"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">gatherv</span>(<span class=sig-arg>sendbuffer</span>,
          <span class=sig-arg>sendcount</span>,
          <span class=sig-arg>sendtype</span>,
          <span class=sig-arg>recvcount</span>,
          <span class=sig-arg>displacements</span>,
          <span class=sig-arg>recvtype</span>,
          <span class=sig-arg>root</span>,
          <span class=sig-arg>comm</span>)</span>
  </h3>
<pre class="literalblock">
receive_buffer = gather( sendbuffer, sendcount, sendtype,
                         recvcount, displacements, recvtype,
                         root, comm)

Gatherv is a special case of gather that allows you to specify
how the data is distributed by passing a displacements array.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="get_count"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">get_count</span>(<span class=sig-arg>datatype</span>)</span>
  </h3>
  count = get_count( datatype )
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="group_incl"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">group_incl</span>(<span class=sig-arg>group</span>,
          <span class=sig-arg>n</span>,
          <span class=sig-arg>ranks</span>)</span>
  </h3>
  group_out = group_incl( group, n, ranks )
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="group_rank"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">group_rank</span>(<span class=sig-arg>group</span>)</span>
  </h3>
  rank = group_rank( group, rank )
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="init"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">init</span>(<span class=sig-arg>argc</span>=<span class=sig-default>None</span>,
          <span class=sig-arg>argv</span>=<span class=sig-default>None</span>)</span>
  </h3>
<pre class="literalblock">
myrank, numprocs = mpi.init( Integer argc, List[String] argv )

myrank = MPI_Rank of the current process
numprocs = The number of processors in mpi.MPI_COMM_WORLD

Typically argc and argv are defined as:
  import sys
  argc = len(sys.argv)
  argv = sys.argv
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="initialized"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">initialized</span>()</span>
  </h3>
<pre class="literalblock">
init_status = mpi.initialized()

Returns 0 if MPI_Init has not been called.
Returns Non-Zero if MPI_Init has been called.

if ( mpi.initialized() ):
  print 'MPI_Init has been called!'
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="iprobe"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">iprobe</span>(<span class=sig-arg>source</span>,
          <span class=sig-arg>tag</span>,
          <span class=sig-arg>comm</span>)</span>
  </h3>
  result = iprobe( source, tag, comm )
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="irecv"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">irecv</span>(<span class=sig-arg>count</span>,
          <span class=sig-arg>datatype</span>,
          <span class=sig-arg>source</span>,
          <span class=sig-arg>tag</span>,
          <span class=sig-arg>comm</span>)</span>
  </h3>
<pre class="literalblock">
request_id, buffer = irecv( count, datatype, source, tag, communicator )

irecv and recv have the same argument list but differ in return values.

receive 'buffer', which consists of 'count' elements of type 'datatype',
from the processor in 'comm' that has rank 'source' and is waiting
for a message with tag == 'tag'.

Request_Id:  This is an integer that provides a handle to pass
to the functions 'test' and 'wait'.  
Buffer:  Can be a single numeric value or a numeric array.
Count:  Number of elements in an array, or 1 for scalar data.
Datatype:  One of a few type constants defined in the mpi module.
Source:  Rank in the specified communicator to receive this message from.
Tag:  An arbitrary value used to route messages more precisely.
      Tags are often ignored (especially in simpler programs).  If
      you don't care what the tag is use:  MPI_ANY_TAG
Comm:  The communicator that contains 'destination'
--------------
Example:

# Start a recv for a 10 element array:
&gt;&gt;&gt; request,buffer = mpi.irecv( 10, mpi.MPI_INT, 0, 0, mpi.MPI_COMM_WORLD )
&gt;&gt;&gt; print 'Request #: %s'%(request)
Request #: 134985008    
&gt;&gt;&gt; print 'buffer: %s'%(buffer)
buffer: [0 0 0 0 0 0 0 0 0 0]
&gt;&gt;&gt; A = Numeric.array([1,2,3,4,5,6,7,8,9,10],Numeric.Int32)
&gt;&gt;&gt; send_request = mpi.isend( A, 10, mpi.MPI_INT, 0, 0, mpi.MPI_COMM_WORLD )
&gt;&gt;&gt; print 'Sending Request: %s'%(send_request)
Sending Request: -1409286143
&gt;&gt;&gt; mpi.wait( request )
&gt;&gt;&gt; print 'buffer(after send): %s'%(buffer)
buffer(after send): [ 1  2  3  4  5  6  7  8  9 10]

--------------

It's important to note that the initial value of 'buffer' is essentially
undefined.  The values in 'buffer' can not be trusted until the irecv
operation is complete.

We can either use test() or wait() to determine that the irecv has
finished.

The wait() call blocks while test() returns immediately.

After the call to wait() buffer is guaranteed to be set.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="isend"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">isend</span>(<span class=sig-arg>buffer</span>,
          <span class=sig-arg>count</span>,
          <span class=sig-arg>datatype</span>,
          <span class=sig-arg>destination</span>,
          <span class=sig-arg>tag</span>,
          <span class=sig-arg>comm</span>)</span>
  </h3>
<pre class="literalblock">
request = isend(buffer, count, datatype, destination, tag, communicator)

Send 'buffer', which consists of 'count' elements of type 'datatype',
to the processor in 'comm' that has rank 'destination' and is waiting
for a message with tag == 'tag'.

Buffer:  Can be a single numeric value or a numeric array.
Count:  Number of elements in an array, or 1 for scalar data.
Datatype:  One of a few type constants defined in the mpi module.
Destination:  Rank in the specified communicator to send this message to.
Tag:  An arbitrary value used to route messages more precisely.
      Tags are often ignored (especially in simpler programs).  If
      you don't care what the tag is use:  MPI_ANY_TAG
Comm:  The communicator that contains 'destination'

Request:  Request is an integer that represents this nonblocking
send operation.  You use this handle to check on the status of this
isend by calling functions like test() and wait().

Example:

request = send( Numeric.ones(10), 10, MPI_INT, 1, 7, MPI_COMM_WORLD )
if ( test( request ) ):
    print 'Send complete!'

# Wait for the send to complete before proceeding:
wait( request )
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="probe"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">probe</span>(<span class=sig-arg>source</span>,
          <span class=sig-arg>tag</span>,
          <span class=sig-arg>comm</span>)</span>
  </h3>
  result = probe( source, tag, comm )
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="recv"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">recv</span>(<span class=sig-arg>count</span>,
          <span class=sig-arg>datatype</span>,
          <span class=sig-arg>source</span>,
          <span class=sig-arg>tag</span>,
          <span class=sig-arg>comm</span>)</span>
  </h3>
<pre class="literalblock">
buffer = recv( count, datatype, source, tag, comm )

receive 'buffer', which consists of 'count' elements of type 'datatype',
from the processor in 'comm' that has rank 'source' and is waiting
for a message with tag == 'tag'.

Buffer:  Can be a single numeric value or a numeric array.
Count:  Number of elements in an array, or 1 for scalar data.
Datatype:  One of a few type constants defined in the mpi module.
Source:  Rank in the specified communicator to receive this message from.
Tag:  An arbitrary value used to route messages more precisely.
      Tags are often ignored (especially in simpler programs).  If
      you don't care what the tag is use:  MPI_ANY_TAG
Comm:  The communicator that contains 'destination'

Example:

# This is the complement to the 'send' example above 
all_ones = recv( 10, MPI_INT, 0, 7, MPI_COMM_WORLD )
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="reduce"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">reduce</span>(<span class=sig-arg>send_buff</span>,
          <span class=sig-arg>count</span>,
          <span class=sig-arg>datatype</span>,
          <span class=sig-arg>op</span>,
          <span class=sig-arg>root</span>,
          <span class=sig-arg>comm</span>)</span>
  </h3>
<pre class="literalblock">
result = reduce( send_buff, count, datatype, op, root, comm )

Example:

  if ( rank = 0 ):
    sum = reduce( partial_result, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD )
  else:
    reduce( partial_result, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD )

'sum' on processor 0 of MPI_COMM_WORLD will contain the sum
of all the 'partial_results' of all the processors in MPI_COMM_WORLD.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="scatter"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">scatter</span>(<span class=sig-arg>sendbuffer</span>,
          <span class=sig-arg>send_count</span>,
          <span class=sig-arg>send_type</span>,
          <span class=sig-arg>receive_count</span>,
          <span class=sig-arg>receive_type</span>,
          <span class=sig-arg>root</span>,
          <span class=sig-arg>comm</span>)</span>
  </h3>
<pre class="literalblock">
receive_buffer = scatter( sendbuffer, send_count, send_type,
                          receive_count, receive_type, root, comm )
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="scatterv"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">scatterv</span>(<span class=sig-arg>sendbuffer</span>,
          <span class=sig-arg>send_count</span>,
          <span class=sig-arg>displacements</span>,
          <span class=sig-arg>send_type</span>,
          <span class=sig-arg>receive_count</span>,
          <span class=sig-arg>receive_type</span>,
          <span class=sig-arg>root</span>,
          <span class=sig-arg>comm</span>)</span>
  </h3>
<pre class="literalblock">
receive_buffer = scatterv( sendbuffer, send_count, displacements,
                   send_type, receive_count, receive_type,
                   root, comm )

Scatterv is a special case of Scatter that allows you to
specify displacements.

displacements : an array of displacements describing
                what part of sendbuffer to copy to each
                processor in comm.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="send"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">send</span>(<span class=sig-arg>buffer</span>,
          <span class=sig-arg>count</span>,
          <span class=sig-arg>datatype</span>,
          <span class=sig-arg>destination</span>,
          <span class=sig-arg>tag</span>,
          <span class=sig-arg>comm</span>)</span>
  </h3>
<pre class="literalblock">
error_code = send( buffer, count, datatype, destination, tag, comm )

Send 'buffer', which consists of 'count' elements of type 'datatype',
to the processor in 'comm' that has rank 'destination' and is waiting
for a message with tag == 'tag'.

Buffer:  Can be a single numeric value or a numeric array.
Count:  Number of elements in an array, or 1 for scalar data.
Datatype:  One of a few type constants defined in the mpi module.
Destination:  Rank in the specified communicator to send this message to.
Tag:  An arbitrary value used to route messages more precisely.
      Tags are often ignored (especially in simpler programs).  If
      you don't care what the tag is use:  MPI_ANY_TAG
Comm:  The communicator that contains 'destination'

Example:

ierr = send( Numeric.ones(10), 10, MPI_INT, 1, 7, MPI_COMM_WORLD )
if( ierr ):
    print 'unable to send message to node 1'
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="status"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">status</span>()</span>
  </h3>
  <p>( source, tag, error ) = status()</p>
  This function returns 3 mpi status bits describing the source, tag, 
  and error.
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="test"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">test</span>(<span class=sig-arg>request</span>)</span>
  </h3>
<pre class="literalblock">
ready = test( request_id )

if ( test( request_id )):
    print 'Non-blocking send or receive operation is complete!'

Note that the request ID is no longer valid after this call
returns successfully and the operation is complete.
</pre>
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="wait"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">wait</span>(<span class=sig-arg>request</span>)</span>
  </h3>
  <p>request_id = wait( request_id )</p>
  <p>request_id,buffer = mpi.irecv( ... ) # Do other work: # ... # wait 
  for the receive to complete so I can use buffer: wait(request_id) print 
  'Received:',buffer</p>
  Invalid Request ID's (ID's for Sends/Recvs that have completed) will 
  cause a crash if they are passed directly to _mpi.mpi_wait.
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="wtick"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">wtick</span>()</span>
  </h3>
  <p>resolution = wtick()</p>
  Returns the resolution of wtime.
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>

<a name="wtime"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
  <h3><span class="sig"><span class="sig-name">wtime</span>()</span>
  </h3>
  <p>time = wtime()</p>
  Returns elapsed time on the calling processor.
  <dl><dt></dt><dd>
  </dd></dl>
</td></tr></table>
<br />


<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="center">
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="http://www.penzilla.net/mmpi/docs/top.shtml">Home</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
    <th class="navbar" align="right" width="100%">
      <table border="0" cellpadding="0" cellspacing="0">
      <tr><th class="navbar" align="center">
        <p class="nomargin">
          <a class="navbar" target="_top" href="http://www.penzilla.net/mmpi/">Project&nbsp;Homepage</a>
      </p></th></tr></table>
    </th>
  </tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td align="left"><font size="-2">Generated by Epydoc 2.1 on Wed Jun 14 14:30:58 2006</font></td>
    <td align="right"><a href="http://epydoc.sourceforge.net"
                      ><font size="-2">http://epydoc.sf.net</font></a></td>
  </tr>
</table>
</body>
</html>
